1. Field of The Invention
The present invention pertains to the field of computer systems. Specifically, the present invention relates to the use of pointers in a computer system.
2. Prior Art
Pointers are used widely for processing information in a computer system. Pointers are references to data items, software functions, other pointers, or any other items (hereinafter referred to as objects) addressable by the address bus of the computer system. Pointers provide a convenient means for directly or indirectly referencing objects and thereby controlling processing flow. As long as pointers correctly reference the intended object, processing flows normally. However, error conditions may occur that cause pointers to incorrectly reference the wrong location. Errors of this type are sometimes called wild pointer references. Wild pointer references are particularly difficult to detect and trace because a wild reference may not be isolated to a predictable portion of the address space within the computer system. For this reason, techniques have been developed in the prior art for tracing wild pointer references by validating pointer references.
One method used in the prior art for detecting and tracing wild references is the use of a defined pointer space in memory in which all objects under debug must reside. In this prior art implementation, pointer reference validation is based on whether a pointer references a location within the defined pointer space or not within the pointer space. When the pointer validation function is enabled, pointer references within the pointer space are validated and allowed to continue. Pointer references outside the defined pointer space are trapped as being wild references that are terminated with an error condition.
In a second prior art implementation, pointer validation may be performed on an object basis. In this second prior art implementation, each reference by any pointer to an object under debug is validated. Validation is performed by comparing the destination address of the pointer reference with the known location of the object under debug. If the reference matches the object location, the pointer reference is validated and allowed to continue. A mismatch between the pointer reference and the object location produces an error condition and the reference is terminated.
Several problems exist in both of the prior art implementations. The first method can be very fast, however, not very accurate. Although wild references outside the defined pointer space will be trapped, wild references to the wrong location but still within the defined pointer space will not be trapped. Thus, the first method will not catch all error conditions.
The second method tends to be very accurate, but also very slow. Because the second prior art method validates every pointer reference to an object, the system overhead for a reference to an object is greatly increased and overall system performance of the computer system is significantly decreased.
Thus, a better means is needed for validating pointer references in a computer system.